#ifndef X_SHELL_COMMAND_H
#define X_SHELL_COMMAND_H 1

#include <string>
#include <vector>

#include <stdint.h>

#include "XBaseClient.h"
#include "XBaseCommand.h"

struct XFamily
{
	std::string mName;
	std::string mGroupName;
	uint32_t mMaxVersion;
	uint32_t mMaxTTL;
	uint32_t mDeadtime;
};

struct XGroup
{
	std::string mName;
	uint32_t mCompressMethod;
	uint32_t mCacheRate;
	uint32_t mBlockSize;
	uint32_t mMaxNumSstable;
	uint32_t mMaxSizeSstable;
	uint32_t mMaxSizeMemtable;	
};

class XShellCommandCreate : public XBaseCommandCreate
{
	std::string mErrorMsg;
public:
	bool parse(const std::string& str);
	std::string errormsg();
};

class XShellCommandDrop : public XBaseCommandDrop
{
	std::string mErrorMsg;
public:
	bool parse(const std::string& str);
	std::string errormsg();
};

class XShellCommandDesc : public XBaseCommandDesc
{
	std::string mErrorMsg;
public:
	bool parse(const std::string& str);
	std::string errormsg();
};

class XShellCommandAlter : public XBaseCommandAlter
{
	std::string mErrorMsg;
public:
	bool parse(const std::string& str);
	std::string errormsg();
};

class XShellCommandInsert : public XBaseCommandInsert
{
	std::string mErrorMsg;
	bool mISRowHex;
	bool mISValueHex;
	bool mISColumnHex;
public:
	bool parse(const std::string& str);
	std::string errormsg();
};

class XShellCommandSelect : public XBaseCommandSelect
{
public:
	std::string mErrorMsg;

	bool mISRowHex;
	bool mISValueHex;
	bool mISColumnHex;

	bool mISRowShow;
	bool mISValueShow;
	bool mISColumnShow;

	bool mUnixtime;
	
public:
	bool parse(const std::string& str);
	std::string errormsg();
};

class XShellCommandScan : public XBaseCommandScan
{
	std::string mErrorMsg;
public:
	bool mISRowHex;
	bool mISValueHex;
	bool mISColumnHex;
	
	bool mISRowShow;
	bool mISValueShow;
	bool mISColumnShow;

	bool mUnixtime;
	
public:
	bool parse(const std::string& str);
	std::string errormsg();
};

class XShellCommandDelete : public XBaseCommandInsert
{
	std::string mErrorMsg;
	bool mISRowHex;
	bool mISValueHex;
	bool mISColumnHex;
public:
	bool parse(const std::string& str);
	std::string errormsg();
};

class XShellCommandShow : public XBaseCommandScan
{
public:
	std::string mTable;
	std::string mErrorMsg;

	bool mISRowHex;
	bool mISValueHex;
	bool mISColumnHex;
	
public:
	bool parse(const std::string& str);
	std::string errormsg();
};

#endif // X_COMMAND_H

